package com.xwm93up.basic.classlifecycle;

import java.sql.SQLOutput;

/**
 * @Description: desc
 * @Author: xwm93up
 * @Since: 2023/2/24 10:01
 */
public class LifeCycle {
    // 静态属性
    private static String staticField = getStaticField();

    // 静态方法快
    static {
        System.out.println(staticField);
        System.out.println("静态方法初始块");
    }

    // 普通属性
    private String filed = getField();

    // 普通方法块
    {
        System.out.println(filed);
    }

    // 构造函数
    public LifeCycle() {
        System.out.println("构造函数初始化");
    }

    private static String getStaticField() {
        String staticFiled = "Static Field Initial";
        return staticFiled;
    }

    private static String getField() {
        String field = "Field Initial";
        return field;
    }

    // 主函数
    public static void main(String[] args) {
        System.out.println("hello 进来了");
        new LifeCycle();
    }
}
